﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Data;
using BandAid.DalCE;

namespace BandAid
{
    public static class Archives 
    {


        public static List<SONGS> SongArchive = new List<SONGS>();
        public static List<ARTISTS> ArtistArchive = new List<ARTISTS>();
        public static List<SHOWS> ShowArchive = new List<SHOWS>();
        public static List<PLACES> PlaceArchive = new List<PLACES>();
        public static List<SHOW_SONGS> ShowSongArchive = new List<SHOW_SONGS>();
        public static List<SHOW_SONGS> NewPlaylistArchive = new List<SHOW_SONGS>();
        

        static Archives()
        {
            if (!BandAid.Gui.WPFBandAid.isRuntime)
                return;

            //Archives.SongArchive.AddRange(from x in ProcessLogic.Instance.dc.SONGs orderby x.ARTIST_ID select x);
            Archives.ArtistArchive.AddRange(from x in ProcessLogic.Instance.dc.ARTISTS orderby x.NAME select x);
            //Archives.ShowArchive.AddRange(from x in ProcessLogic.Instance.dc.SHOWs orderby x.DATE select x);
            Archives.PlaceArchive.AddRange(from x in ProcessLogic.Instance.dc.PLACES orderby x.NAME select x);
            //Archives.NewPlaylistArchive = new List<SHOW_SONGS>();
        }

        #region WPF Dataproviders

        public static BindingList<ARTISTS> GetArtistArchive()
        {
            BindingList<ARTISTS> a = new BindingList<ARTISTS>(ArtistArchive);


            return a;
        }

        public static BindingList<SONGS> GetSongsArchive()
        {
            BindingList<SONGS> a = new BindingList<SONGS>(SongArchive);
            
            return a;
        }

        public static BindingList<PLACES> GetPlacesArchive()
        {
            BindingList<PLACES> a = new BindingList<PLACES>(PlaceArchive);

            return a;
        }

        public static BindingList<SHOWS> GetShowsArchive()
        {
            BindingList<SHOWS> a = new BindingList<SHOWS>(ShowArchive);

            return a;
        }

        public static BindingList<SHOW_SONGS> GetShowSongsArchive()
        {
            BindingList<SHOW_SONGS> a = new BindingList<SHOW_SONGS>(ShowSongArchive);

            return a;
        }


        public static BindingList<SHOW_SONGS> GetNewPlaylistArchive()
        {
            BindingList<SHOW_SONGS> a = new BindingList<SHOW_SONGS>(NewPlaylistArchive);

            return a;
        }

        #endregion
    }


}
